switch (Cont.)
Pascal
C/C++
w
case i of
w
0: write(‘ZeroOne’);
w
1: write(‘One’)
w
end;
switch (i)
{
case 0: printf(“Zero”);
case 1: printf(“One”);
}
If the breaks are omitted, control flows through case to
case. Thus, the following are equivalent: